
package hotelroom;

//import statements
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;

/**
 *
 * @author Hendry Yuwono
 * 
 * This is a getter setter class that will help to switch between icons
 */
public class ValueHandler {
    //create variables
    private static JButton btn;
    private static JButton b;
    private static int lvl;
    private static boolean bool;
    /**
     * 
     * @param b will take JButton value
     */
    public void setNewIcon(JButton b){
        Icon unlocked = new ImageIcon(getClass().getResource("unlocked.png"));
        btn = b;
        btn.setIcon(unlocked);
        btn.repaint();
    }
    /**
     * 
     * @return return variable 'btn' as JButton 
     */
    public JButton getNewIcon(){
        return btn;
    }
    
    /**
     * 
     * @return return variable 'b' as JButton 
     */
    public JButton getButton(){
        return b;
    }
    
    /**
     * 
     * @param nb will take JButton value
     */
    public void setButton(JButton nb){
        b = nb;
    }
    
    public void setLevel(int newlvl){
        lvl = newlvl;
    }
    
    public int getLevel()
    {
        return lvl;
    }
    
    public void setLvlIsChanged(boolean b){
        bool = b;
    }
    public boolean getLvlIsChanged()
    {
        return bool;
    }
}
